<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts   #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes         #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Program.Db</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   :  Isaac Jones 2006, Duncan Coutts 2007-2009</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- This provides a 'ProgramDb' type which holds configured and not-yet</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- configured programs. It is the parameter to lots of actions elsewhere in</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Cabal that need to look up and run programs. If we had a Cabal monad,</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- the 'ProgramDb' would probably be a reader or state component of it.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- One nice thing about using it is that any program that is</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- registered with Cabal will get some \&quot;configure\&quot; and \&quot;.cabal\&quot;</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- helpers like --with-foo-args --foo-path= and extra-foo-args.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- There's also a hook for adding programs in a Setup.lhs script.  See</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- hookedPrograms in 'Distribution.Simple.UserHooks'.  This gives a</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- hook user the ability to get the above flags and such so that they</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- don't have to write all the PATH logic inside Setup.lhs.</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Program.Db</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The collection of configured programs we can run</span></span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier">ProgramDb</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier">emptyProgramDb</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#defaultProgramDb"><span class="hs-identifier">defaultProgramDb</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#restoreProgramDb"><span class="hs-identifier">restoreProgramDb</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Query and manipulate the program db</span></span><span>
</span><span id="line-35"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#addKnownProgram"><span class="hs-identifier">addKnownProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#addKnownPrograms"><span class="hs-identifier">addKnownPrograms</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupKnownProgram"><span class="hs-identifier">lookupKnownProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#knownPrograms"><span class="hs-identifier">knownPrograms</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#getProgramSearchPath"><span class="hs-identifier">getProgramSearchPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#setProgramSearchPath"><span class="hs-identifier">setProgramSearchPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#modifyProgramSearchPath"><span class="hs-identifier">modifyProgramSearchPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyPath"><span class="hs-identifier">userSpecifyPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyPaths"><span class="hs-identifier">userSpecifyPaths</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userMaybeSpecifyPath"><span class="hs-identifier">userMaybeSpecifyPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyArgs"><span class="hs-identifier">userSpecifyArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyArgss"><span class="hs-identifier">userSpecifyArgss</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifiedArgs"><span class="hs-identifier">userSpecifiedArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier">lookupProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#updateProgram"><span class="hs-identifier">updateProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configuredPrograms"><span class="hs-identifier">configuredPrograms</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Query and manipulate the program db</span></span><span>
</span><span id="line-53"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier">configureProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configureAllKnownPrograms"><span class="hs-identifier">configureAllKnownPrograms</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#unconfigureProgram"><span class="hs-identifier">unconfigureProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupProgramVersion"><span class="hs-identifier">lookupProgramVersion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#reconfigurePrograms"><span class="hs-identifier">reconfigurePrograms</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#requireProgram"><span class="hs-identifier">requireProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#requireProgramVersion"><span class="hs-identifier">requireProgramVersion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#needProgram"><span class="hs-identifier">needProgram</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Builtin.html"><span class="hs-identifier">Distribution.Simple.Program.Builtin</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html"><span class="hs-identifier">Distribution.Simple.Program.Find</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html"><span class="hs-identifier">Distribution.Simple.Program.Types</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.Structured.html"><span class="hs-identifier">Distribution.Utils.Structured</span></a></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.Structured.html#Structure"><span class="hs-identifier">Structure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.Structured.html#Structured"><span class="hs-identifier">Structured</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Version.html"><span class="hs-identifier">Distribution.Version</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Tuple.html#"><span class="hs-identifier">Data.Tuple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Tuple.html#swap"><span class="hs-identifier">swap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- * Programs database</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-comment">-- | The configuration is a collection of information about programs. It</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- contains information both about configured programs and also about programs</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- that we are yet to configure.</span><span>
</span><span id="line-87"></span><span class="hs-comment">--</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- The idea is that we start from a collection of unconfigured programs and one</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- by one we try to configure them at which point we move them into the</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- configured collection. For unconfigured programs we record not just the</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- 'Program' but also any user-provided arguments and location for the program.</span><span>
</span><span id="line-92"></span><span class="hs-keyword">data</span><span> </span><span id="ProgramDb"><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-var">ProgramDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ProgramDb"><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-var">ProgramDb</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-93"></span><span>        </span><span id="unconfiguredProgs"><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgs"><span class="hs-identifier hs-type">UnconfiguredProgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-94"></span><span>        </span><span id="progSearchPath"><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-95"></span><span>        </span><span id="configuredProgs"><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ConfiguredProgs"><span class="hs-identifier hs-type">ConfiguredProgs</span></a></span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-97"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Typeable.Internal.html#Typeable"><span class="hs-identifier hs-type">Typeable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">type</span><span> </span><span id="UnconfiguredProgram"><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgram"><span class="hs-identifier hs-var">UnconfiguredProgram</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ProgArg"><span class="hs-identifier hs-type">ProgArg</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span class="hs-keyword">type</span><span> </span><span id="UnconfiguredProgs"><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgs"><span class="hs-identifier hs-var">UnconfiguredProgs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map.Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgram"><span class="hs-identifier hs-type">UnconfiguredProgram</span></a></span><span>
</span><span id="line-101"></span><span class="hs-keyword">type</span><span> </span><span id="ConfiguredProgs"><span class="annot"><a href="Distribution.Simple.Program.Db.html#ConfiguredProgs"><span class="hs-identifier hs-var">ConfiguredProgs</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map.Map</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier hs-type">emptyProgramDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-105"></span><span id="emptyProgramDb"><span class="annot"><span class="annottext">emptyProgramDb :: ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier hs-var hs-var">emptyProgramDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs
-&gt; ProgramSearchPath -&gt; ConfiguredProgs -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-var">ProgramDb</span></a></span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramSearchPath
</span><a href="Distribution.Simple.Program.Find.html#defaultProgramSearchPath"><span class="hs-identifier hs-var">defaultProgramSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgs
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#defaultProgramDb"><span class="hs-identifier hs-type">defaultProgramDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-108"></span><span id="defaultProgramDb"><span class="annot"><span class="annottext">defaultProgramDb :: ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#defaultProgramDb"><span class="hs-identifier hs-var hs-var">defaultProgramDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Program] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#restoreProgramDb"><span class="hs-identifier hs-var">restoreProgramDb</span></a></span><span> </span><span class="annot"><span class="annottext">[Program]
</span><a href="Distribution.Simple.Program.Builtin.html#builtinPrograms"><span class="hs-identifier hs-var">builtinPrograms</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier hs-var">emptyProgramDb</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span class="hs-comment">-- internal helpers:</span><span>
</span><span id="line-112"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#updateUnconfiguredProgs"><span class="hs-identifier hs-type">updateUnconfiguredProgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgs"><span class="hs-identifier hs-type">UnconfiguredProgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#UnconfiguredProgs"><span class="hs-identifier hs-type">UnconfiguredProgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-114"></span><span id="updateUnconfiguredProgs"><span class="annot"><span class="annottext">updateUnconfiguredProgs :: (UnconfiguredProgs -&gt; UnconfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateUnconfiguredProgs"><span class="hs-identifier hs-var hs-var">updateUnconfiguredProgs</span></a></span></span><span> </span><span id="local-6989586621679688711"><span class="annot"><span class="annottext">UnconfiguredProgs -&gt; UnconfiguredProgs
</span><a href="#local-6989586621679688711"><span class="hs-identifier hs-var">update</span></a></span></span><span> </span><span id="local-6989586621679688710"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688710"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-115"></span><span>  </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688710"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">unconfiguredProgs :: UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var">unconfiguredProgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs -&gt; UnconfiguredProgs
</span><a href="#local-6989586621679688711"><span class="hs-identifier hs-var">update</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688710"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-type">updateConfiguredProgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ConfiguredProgs"><span class="hs-identifier hs-type">ConfiguredProgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ConfiguredProgs"><span class="hs-identifier hs-type">ConfiguredProgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-118"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-119"></span><span id="updateConfiguredProgs"><span class="annot"><span class="annottext">updateConfiguredProgs :: (ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-var hs-var">updateConfiguredProgs</span></a></span></span><span> </span><span id="local-6989586621679688708"><span class="annot"><span class="annottext">ConfiguredProgs -&gt; ConfiguredProgs
</span><a href="#local-6989586621679688708"><span class="hs-identifier hs-var">update</span></a></span></span><span> </span><span id="local-6989586621679688707"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688707"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-120"></span><span>  </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688707"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">configuredProgs :: ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var">configuredProgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgs -&gt; ConfiguredProgs
</span><a href="#local-6989586621679688708"><span class="hs-identifier hs-var">update</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688707"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-comment">-- Read &amp; Show instances are based on listToFM</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | Note that this instance does not preserve the known 'Program's.</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- See 'restoreProgramDb' for details.</span><span>
</span><span id="line-127"></span><span class="hs-comment">--</span><span>
</span><span id="line-128"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679688702"><span id="local-6989586621679688705"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-129"></span><span>  </span><span id="local-6989586621679688691"><span class="annot"><span class="annottext">show :: ProgramDb -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, ConfiguredProgram)] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">([(String, ConfiguredProgram)] -&gt; String)
-&gt; (ProgramDb -&gt; [(String, ConfiguredProgram)])
-&gt; ProgramDb
-&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgs -&gt; [(String, ConfiguredProgram)]
forall k a. Map k a -&gt; [(k, a)]
</span><a href="../../containers/src/Data.Map.Internal.html#toAscList"><span class="hs-identifier hs-var">Map.toAscList</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; [(String, ConfiguredProgram)])
-&gt; (ProgramDb -&gt; ConfiguredProgs)
-&gt; ProgramDb
-&gt; [(String, ConfiguredProgram)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- | Note that this instance does not preserve the known 'Program's.</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- See 'restoreProgramDb' for details.</span><span>
</span><span id="line-133"></span><span class="hs-comment">--</span><span>
</span><span id="line-134"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679688681"><span id="local-6989586621679688683"><span id="local-6989586621679688685"><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>  </span><span id="local-6989586621679688669"><span class="annot"><span class="annottext">readsPrec :: Int -&gt; ReadS ProgramDb
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readsPrec</span></a></span></span><span> </span><span id="local-6989586621679688667"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679688667"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679688666"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688666"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-136"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier hs-var">emptyProgramDb</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">configuredProgs :: ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var">configuredProgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, ConfiguredProgram)] -&gt; ConfiguredProgs
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, ConfiguredProgram)]
</span><a href="#local-6989586621679688664"><span class="hs-identifier hs-var">s'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688663"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688664"><span class="annot"><span class="annottext">[(String, ConfiguredProgram)]
</span><a href="#local-6989586621679688664"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688663"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688663"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS [(String, ConfiguredProgram)]
forall a. Read a =&gt; Int -&gt; ReadS a
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var">readsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679688667"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688666"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="hs-comment">-- | Note that this instance does not preserve the known 'Program's.</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- See 'restoreProgramDb' for details.</span><span>
</span><span id="line-141"></span><span class="hs-comment">--</span><span>
</span><span id="line-142"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679688659"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-143"></span><span>  </span><span id="local-6989586621679688644"><span class="annot"><span class="annottext">put :: ProgramDb -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span id="local-6989586621679688642"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688642"><span class="hs-identifier hs-var">db</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-144"></span><span>    </span><span class="annot"><span class="annottext">ProgramSearchPath -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688642"><span class="hs-identifier hs-var">db</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>    </span><span class="annot"><span class="annottext">ConfiguredProgs -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688642"><span class="hs-identifier hs-var">db</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span>  </span><span id="local-6989586621679688631"><span class="annot"><span class="annottext">get :: Get ProgramDb
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-148"></span><span>    </span><span id="local-6989586621679688629"><span class="annot"><span class="annottext">ProgramSearchPath
</span><a href="#local-6989586621679688629"><span class="hs-identifier hs-var">searchpath</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ProgramSearchPath
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-149"></span><span>    </span><span id="local-6989586621679688628"><span class="annot"><span class="annottext">ConfiguredProgs
</span><a href="#local-6989586621679688628"><span class="hs-identifier hs-var">progs</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ConfiguredProgs
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-150"></span><span>    </span><span class="annot"><span class="annottext">ProgramDb -&gt; Get ProgramDb
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ProgramDb -&gt; Get ProgramDb) -&gt; ProgramDb -&gt; Get ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#emptyProgramDb"><span class="hs-identifier hs-var">emptyProgramDb</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-151"></span><span>      </span><span class="annot"><span class="annottext">progSearchPath :: ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var">progSearchPath</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramSearchPath
</span><a href="#local-6989586621679688629"><span class="hs-identifier hs-var">searchpath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-152"></span><span>      </span><span class="annot"><span class="annottext">configuredProgs :: ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var">configuredProgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgs
</span><a href="#local-6989586621679688628"><span class="hs-identifier hs-var">progs</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679688622"><span class="annot"><a href="Distribution.Utils.Structured.html#Structured"><span class="hs-identifier hs-type">Structured</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621679688606"><span class="annot"><span class="annottext">structure :: Proxy ProgramDb -&gt; Structure
</span><a href="Distribution.Utils.Structured.html#structure"><span class="hs-identifier hs-var hs-var hs-var hs-var">structure</span></a></span></span><span> </span><span id="local-6989586621679688604"><span class="annot"><span class="annottext">Proxy ProgramDb
</span><a href="#local-6989586621679688604"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypeRep -&gt; TypeVersion -&gt; String -&gt; [Structure] -&gt; Structure
</span><a href="Distribution.Utils.Structured.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy ProgramDb -&gt; TypeRep
forall {k} (proxy :: k -&gt; *) (a :: k).
Typeable a =&gt;
proxy a -&gt; TypeRep
</span><a href="../../base/src/Data.Typeable.html#typeRep"><span class="hs-identifier hs-var">typeRep</span></a></span><span> </span><span class="annot"><span class="annottext">Proxy ProgramDb
</span><a href="#local-6989586621679688604"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TypeVersion
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ProgramDb&quot;</span></span><span>
</span><span id="line-157"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Proxy ProgramSearchPath -&gt; Structure
forall a. Structured a =&gt; Proxy a -&gt; Structure
</span><a href="Distribution.Utils.Structured.html#structure"><span class="hs-identifier hs-var">structure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy ProgramSearchPath
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Proxy ConfiguredProgs -&gt; Structure
forall a. Structured a =&gt; Proxy a -&gt; Structure
</span><a href="Distribution.Utils.Structured.html#structure"><span class="hs-identifier hs-var">structure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Proxy ConfiguredProgs
forall {k} (t :: k). Proxy t
</span><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-var">Proxy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Proxy.html#Proxy"><span class="hs-identifier hs-type">Proxy</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ConfiguredProgs"><span class="hs-identifier hs-type">ConfiguredProgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-159"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- | The 'Read'\/'Show' and 'Binary' instances do not preserve all the</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- unconfigured 'Programs' because 'Program' is not in 'Read'\/'Show' because</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- it contains functions. So to fully restore a deserialised 'ProgramDb' use</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- this function to add back all the known 'Program's.</span><span>
</span><span id="line-166"></span><span class="hs-comment">--</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- * It does not add the default programs, but you probably want them, use</span><span>
</span><span id="line-168"></span><span class="hs-comment">--   'builtinPrograms' in addition to any extra you might need.</span><span>
</span><span id="line-169"></span><span class="hs-comment">--</span><span>
</span><span id="line-170"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#restoreProgramDb"><span class="hs-identifier hs-type">restoreProgramDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-171"></span><span id="restoreProgramDb"><span class="annot"><span class="annottext">restoreProgramDb :: [Program] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#restoreProgramDb"><span class="hs-identifier hs-var hs-var">restoreProgramDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Program] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#addKnownPrograms"><span class="hs-identifier hs-var">addKnownPrograms</span></a></span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">-- -------------------------------</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- Managing unconfigured programs</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | Add a known program that we may configure later</span><span>
</span><span id="line-178"></span><span class="hs-comment">--</span><span>
</span><span id="line-179"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#addKnownProgram"><span class="hs-identifier hs-type">addKnownProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-180"></span><span id="addKnownProgram"><span class="annot"><span class="annottext">addKnownProgram :: Program -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#addKnownProgram"><span class="hs-identifier hs-var hs-var">addKnownProgram</span></a></span></span><span> </span><span id="local-6989586621679688600"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688600"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; UnconfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateUnconfiguredProgs"><span class="hs-identifier hs-var">updateUnconfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">((UnconfiguredProgs -&gt; UnconfiguredProgs)
 -&gt; ProgramDb -&gt; ProgramDb)
-&gt; (UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; ProgramDb
-&gt; ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-181"></span><span>  </span><span class="annot"><span class="annottext">((Program, Maybe String, [String])
 -&gt; (Program, Maybe String, [String])
 -&gt; (Program, Maybe String, [String]))
-&gt; String
-&gt; (Program, Maybe String, [String])
-&gt; UnconfiguredProgs
-&gt; UnconfiguredProgs
forall k a. Ord k =&gt; (a -&gt; a -&gt; a) -&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insertWith"><span class="hs-identifier hs-var">Map.insertWith</span></a></span><span> </span><span class="annot"><span class="annottext">(Program, Maybe String, [String])
-&gt; (Program, Maybe String, [String])
-&gt; (Program, Maybe String, [String])
forall {p} {a} {b} {c}. p -&gt; (a, b, c) -&gt; (Program, b, c)
</span><a href="#local-6989586621679688598"><span class="hs-identifier hs-var">combine</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688600"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688600"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679688598"><span class="annot"><span class="annottext">combine :: p -&gt; (a, b, c) -&gt; (Program, b, c)
</span><a href="#local-6989586621679688598"><span class="hs-identifier hs-var hs-var">combine</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688596"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679688596"><span class="hs-identifier hs-var">path</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688595"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679688595"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688600"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679688596"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679688595"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#addKnownPrograms"><span class="hs-identifier hs-type">addKnownPrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-186"></span><span id="addKnownPrograms"><span class="annot"><span class="annottext">addKnownPrograms :: [Program] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#addKnownPrograms"><span class="hs-identifier hs-var hs-var">addKnownPrograms</span></a></span></span><span> </span><span id="local-6989586621679688594"><span class="annot"><span class="annottext">[Program]
</span><a href="#local-6989586621679688594"><span class="hs-identifier hs-var">progs</span></a></span></span><span> </span><span id="local-6989586621679688593"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688593"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ProgramDb -&gt; Program -&gt; ProgramDb)
-&gt; ProgramDb -&gt; [Program] -&gt; ProgramDb
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Program -&gt; ProgramDb -&gt; ProgramDb)
-&gt; ProgramDb -&gt; Program -&gt; ProgramDb
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#addKnownProgram"><span class="hs-identifier hs-var">addKnownProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688593"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="annot"><span class="annottext">[Program]
</span><a href="#local-6989586621679688594"><span class="hs-identifier hs-var">progs</span></a></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupKnownProgram"><span class="hs-identifier hs-type">lookupKnownProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span>
</span><span id="line-190"></span><span id="lookupKnownProgram"><span class="annot"><span class="annottext">lookupKnownProgram :: String -&gt; ProgramDb -&gt; Maybe Program
</span><a href="Distribution.Simple.Program.Db.html#lookupKnownProgram"><span class="hs-identifier hs-var hs-var">lookupKnownProgram</span></a></span></span><span> </span><span id="local-6989586621679688590"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688590"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-191"></span><span>  </span><span class="annot"><span class="annottext">((Program, Maybe String, [String]) -&gt; Program)
-&gt; Maybe (Program, Maybe String, [String]) -&gt; Maybe Program
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679688589"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688589"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[String]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688589"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe (Program, Maybe String, [String]) -&gt; Maybe Program)
-&gt; (ProgramDb -&gt; Maybe (Program, Maybe String, [String]))
-&gt; ProgramDb
-&gt; Maybe Program
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String
-&gt; UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String])
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688590"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String]))
-&gt; (ProgramDb -&gt; UnconfiguredProgs)
-&gt; ProgramDb
-&gt; Maybe (Program, Maybe String, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span>
</span><span id="line-192"></span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#knownPrograms"><span class="hs-identifier hs-type">knownPrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-195"></span><span id="knownPrograms"><span class="annot"><span class="annottext">knownPrograms :: ProgramDb -&gt; [(Program, Maybe ConfiguredProgram)]
</span><a href="Distribution.Simple.Program.Db.html#knownPrograms"><span class="hs-identifier hs-var hs-var">knownPrograms</span></a></span></span><span> </span><span id="local-6989586621679688587"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688587"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-196"></span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688586"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe ConfiguredProgram
</span><a href="#local-6989586621679688585"><span class="hs-identifier hs-var">p'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688586"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688586"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[String]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs -&gt; [(Program, Maybe String, [String])]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688587"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679688585"><span class="annot"><span class="annottext">p' :: Maybe ConfiguredProgram
</span><a href="#local-6989586621679688585"><span class="hs-identifier hs-var hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ConfiguredProgs -&gt; Maybe ConfiguredProgram
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688586"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688587"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-comment">-- | Get the current 'ProgramSearchPath' used by the 'ProgramDb'.</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- This is the default list of locations where programs are looked for when</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- configuring them. This can be overridden for specific programs (with</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- 'userSpecifyPath'), and specific known programs can modify or ignore this</span><span>
</span><span id="line-203"></span><span class="hs-comment">-- search path in their own configuration code.</span><span>
</span><span id="line-204"></span><span class="hs-comment">--</span><span>
</span><span id="line-205"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#getProgramSearchPath"><span class="hs-identifier hs-type">getProgramSearchPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span>
</span><span id="line-206"></span><span id="getProgramSearchPath"><span class="annot"><span class="annottext">getProgramSearchPath :: ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#getProgramSearchPath"><span class="hs-identifier hs-var hs-var">getProgramSearchPath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="hs-comment">-- | Change the current 'ProgramSearchPath' used by the 'ProgramDb'.</span><span>
</span><span id="line-209"></span><span class="hs-comment">-- This will affect programs that are configured from here on, so you</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- should usually set it before configuring any programs.</span><span>
</span><span id="line-211"></span><span class="hs-comment">--</span><span>
</span><span id="line-212"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#setProgramSearchPath"><span class="hs-identifier hs-type">setProgramSearchPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-213"></span><span id="setProgramSearchPath"><span class="annot"><span class="annottext">setProgramSearchPath :: ProgramSearchPath -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#setProgramSearchPath"><span class="hs-identifier hs-var hs-var">setProgramSearchPath</span></a></span></span><span> </span><span id="local-6989586621679688581"><span class="annot"><span class="annottext">ProgramSearchPath
</span><a href="#local-6989586621679688581"><span class="hs-identifier hs-var">searchpath</span></a></span></span><span> </span><span id="local-6989586621679688580"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688580"><span class="hs-identifier hs-var">db</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688580"><span class="hs-identifier hs-var">db</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">progSearchPath :: ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var">progSearchPath</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramSearchPath
</span><a href="#local-6989586621679688581"><span class="hs-identifier hs-var">searchpath</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">-- | Modify the current 'ProgramSearchPath' used by the 'ProgramDb'.</span><span>
</span><span id="line-216"></span><span class="hs-comment">-- This will affect programs that are configured from here on, so you</span><span>
</span><span id="line-217"></span><span class="hs-comment">-- should usually modify it before configuring any programs.</span><span>
</span><span id="line-218"></span><span class="hs-comment">--</span><span>
</span><span id="line-219"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#modifyProgramSearchPath"><span class="hs-identifier hs-type">modifyProgramSearchPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Find.html#ProgramSearchPath"><span class="hs-identifier hs-type">ProgramSearchPath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-221"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-222"></span><span id="modifyProgramSearchPath"><span class="annot"><span class="annottext">modifyProgramSearchPath :: (ProgramSearchPath -&gt; ProgramSearchPath) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#modifyProgramSearchPath"><span class="hs-identifier hs-var hs-var">modifyProgramSearchPath</span></a></span></span><span> </span><span id="local-6989586621679688579"><span class="annot"><span class="annottext">ProgramSearchPath -&gt; ProgramSearchPath
</span><a href="#local-6989586621679688579"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679688578"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688578"><span class="hs-identifier hs-var">db</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-223"></span><span>  </span><span class="annot"><span class="annottext">ProgramSearchPath -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#setProgramSearchPath"><span class="hs-identifier hs-var">setProgramSearchPath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramSearchPath -&gt; ProgramSearchPath
</span><a href="#local-6989586621679688579"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(ProgramSearchPath -&gt; ProgramSearchPath)
-&gt; ProgramSearchPath -&gt; ProgramSearchPath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#getProgramSearchPath"><span class="hs-identifier hs-var">getProgramSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688578"><span class="hs-identifier hs-var">db</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688578"><span class="hs-identifier hs-var">db</span></a></span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span class="hs-comment">-- |User-specify this path.  Basically override any path information</span><span>
</span><span id="line-226"></span><span class="hs-comment">-- for this program in the configuration. If it's not a known</span><span>
</span><span id="line-227"></span><span class="hs-comment">-- program ignore it.</span><span>
</span><span id="line-228"></span><span class="hs-comment">--</span><span>
</span><span id="line-229"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyPath"><span class="hs-identifier hs-type">userSpecifyPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>   </span><span class="hs-comment">-- ^Program name</span><span>
</span><span id="line-230"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-comment">-- ^user-specified path to the program</span><span>
</span><span id="line-231"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-232"></span><span id="userSpecifyPath"><span class="annot"><span class="annottext">userSpecifyPath :: String -&gt; String -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyPath"><span class="hs-identifier hs-var hs-var">userSpecifyPath</span></a></span></span><span> </span><span id="local-6989586621679688577"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688577"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679688576"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688576"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; UnconfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateUnconfiguredProgs"><span class="hs-identifier hs-var">updateUnconfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">((UnconfiguredProgs -&gt; UnconfiguredProgs)
 -&gt; ProgramDb -&gt; ProgramDb)
-&gt; (UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; ProgramDb
-&gt; ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-233"></span><span>  </span><span class="annot"><span class="annottext">(((Program, Maybe String, [String])
  -&gt; Maybe (Program, Maybe String, [String]))
 -&gt; String -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; String
-&gt; ((Program, Maybe String, [String])
    -&gt; Maybe (Program, Maybe String, [String]))
-&gt; UnconfiguredProgs
-&gt; UnconfiguredProgs
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">((Program, Maybe String, [String])
 -&gt; Maybe (Program, Maybe String, [String]))
-&gt; String -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs
forall k a. Ord k =&gt; (a -&gt; Maybe a) -&gt; k -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#update"><span class="hs-identifier hs-var">Map.update</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688577"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">(((Program, Maybe String, [String])
  -&gt; Maybe (Program, Maybe String, [String]))
 -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; ((Program, Maybe String, [String])
    -&gt; Maybe (Program, Maybe String, [String]))
-&gt; UnconfiguredProgs
-&gt; UnconfiguredProgs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679688574"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688574"><span class="hs-identifier hs-var">prog</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688573"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688573"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Program, Maybe String, [String])
-&gt; Maybe (Program, Maybe String, [String])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688574"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688576"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688573"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span>
</span><span id="line-236"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userMaybeSpecifyPath"><span class="hs-identifier hs-type">userMaybeSpecifyPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-237"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-238"></span><span id="userMaybeSpecifyPath"><span class="annot"><span class="annottext">userMaybeSpecifyPath :: String -&gt; Maybe String -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userMaybeSpecifyPath"><span class="hs-identifier hs-var hs-var">userMaybeSpecifyPath</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>    </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621679688572"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688572"><span class="hs-identifier hs-var">progdb</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688572"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-239"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userMaybeSpecifyPath"><span class="hs-identifier hs-var">userMaybeSpecifyPath</span></a></span><span> </span><span id="local-6989586621679688571"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688571"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688570"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688570"><span class="hs-identifier hs-var">path</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679688569"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688569"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyPath"><span class="hs-identifier hs-var">userSpecifyPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688571"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688570"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688569"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- |User-specify the arguments for this program.  Basically override</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- any args information for this program in the configuration. If it's</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- not a known program, ignore it..</span><span>
</span><span id="line-245"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyArgs"><span class="hs-identifier hs-type">userSpecifyArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>    </span><span class="hs-comment">-- ^Program name</span><span>
</span><span id="line-246"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ProgArg"><span class="hs-identifier hs-type">ProgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^user-specified args</span><span>
</span><span id="line-247"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-248"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-249"></span><span id="userSpecifyArgs"><span class="annot"><span class="annottext">userSpecifyArgs :: String -&gt; [String] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyArgs"><span class="hs-identifier hs-var hs-var">userSpecifyArgs</span></a></span></span><span> </span><span id="local-6989586621679688568"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688568"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679688567"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688567"><span class="hs-identifier hs-var">args'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-250"></span><span>    </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; UnconfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateUnconfiguredProgs"><span class="hs-identifier hs-var">updateUnconfiguredProgs</span></a></span><span>
</span><span id="line-251"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(((Program, Maybe String, [String])
  -&gt; Maybe (Program, Maybe String, [String]))
 -&gt; String -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; String
-&gt; ((Program, Maybe String, [String])
    -&gt; Maybe (Program, Maybe String, [String]))
-&gt; UnconfiguredProgs
-&gt; UnconfiguredProgs
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">((Program, Maybe String, [String])
 -&gt; Maybe (Program, Maybe String, [String]))
-&gt; String -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs
forall k a. Ord k =&gt; (a -&gt; Maybe a) -&gt; k -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#update"><span class="hs-identifier hs-var">Map.update</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688568"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">(((Program, Maybe String, [String])
  -&gt; Maybe (Program, Maybe String, [String]))
 -&gt; UnconfiguredProgs -&gt; UnconfiguredProgs)
-&gt; ((Program, Maybe String, [String])
    -&gt; Maybe (Program, Maybe String, [String]))
-&gt; UnconfiguredProgs
-&gt; UnconfiguredProgs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-252"></span><span>         </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679688566"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688566"><span class="hs-identifier hs-var">prog</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688565"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679688565"><span class="hs-identifier hs-var">path</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688564"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688564"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Program, Maybe String, [String])
-&gt; Maybe (Program, Maybe String, [String])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688566"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679688565"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688564"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688567"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span>  </span><span class="annot"><span class="annottext">(ProgramDb -&gt; ProgramDb)
-&gt; (ProgramDb -&gt; ProgramDb) -&gt; ProgramDb -&gt; ProgramDb
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-var">updateConfiguredProgs</span></a></span><span>
</span><span id="line-254"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((ConfiguredProgram -&gt; Maybe ConfiguredProgram)
 -&gt; String -&gt; ConfiguredProgs -&gt; ConfiguredProgs)
-&gt; String
-&gt; (ConfiguredProgram -&gt; Maybe ConfiguredProgram)
-&gt; ConfiguredProgs
-&gt; ConfiguredProgs
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgram -&gt; Maybe ConfiguredProgram)
-&gt; String -&gt; ConfiguredProgs -&gt; ConfiguredProgs
forall k a. Ord k =&gt; (a -&gt; Maybe a) -&gt; k -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#update"><span class="hs-identifier hs-var">Map.update</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688568"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">((ConfiguredProgram -&gt; Maybe ConfiguredProgram)
 -&gt; ConfiguredProgs -&gt; ConfiguredProgs)
-&gt; (ConfiguredProgram -&gt; Maybe ConfiguredProgram)
-&gt; ConfiguredProgs
-&gt; ConfiguredProgs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-255"></span><span>         </span><span class="hs-glyph">\</span><span id="local-6989586621679688563"><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688563"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; Maybe ConfiguredProgram
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688563"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">programOverrideArgs :: [String]
</span><a href="Distribution.Simple.Program.Types.html#programOverrideArgs"><span class="hs-identifier hs-var">programOverrideArgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; [String]
</span><a href="Distribution.Simple.Program.Types.html#programOverrideArgs"><span class="hs-identifier hs-var hs-var">programOverrideArgs</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688563"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-256"></span><span>                                                 </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688567"><span class="hs-identifier hs-var">args'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-- | Like 'userSpecifyPath' but for a list of progs and their paths.</span><span>
</span><span id="line-260"></span><span class="hs-comment">--</span><span>
</span><span id="line-261"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyPaths"><span class="hs-identifier hs-type">userSpecifyPaths</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-262"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-263"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-264"></span><span id="userSpecifyPaths"><span class="annot"><span class="annottext">userSpecifyPaths :: [(String, String)] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyPaths"><span class="hs-identifier hs-var hs-var">userSpecifyPaths</span></a></span></span><span> </span><span id="local-6989586621679688561"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679688561"><span class="hs-identifier hs-var">paths</span></a></span></span><span> </span><span id="local-6989586621679688560"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688560"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-265"></span><span>  </span><span class="annot"><span class="annottext">(ProgramDb -&gt; (String, String) -&gt; ProgramDb)
-&gt; ProgramDb -&gt; [(String, String)] -&gt; ProgramDb
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679688559"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688559"><span class="hs-identifier hs-var">progdb'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688558"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688558"><span class="hs-identifier hs-var">prog</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688557"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688557"><span class="hs-identifier hs-var">path</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyPath"><span class="hs-identifier hs-var">userSpecifyPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688558"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688557"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688559"><span class="hs-identifier hs-var">progdb'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688560"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679688561"><span class="hs-identifier hs-var">paths</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- | Like 'userSpecifyPath' but for a list of progs and their args.</span><span>
</span><span id="line-269"></span><span class="hs-comment">--</span><span>
</span><span id="line-270"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifyArgss"><span class="hs-identifier hs-type">userSpecifyArgss</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ProgArg"><span class="hs-identifier hs-type">ProgArg</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-271"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-272"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-273"></span><span id="userSpecifyArgss"><span class="annot"><span class="annottext">userSpecifyArgss :: [(String, [String])] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyArgss"><span class="hs-identifier hs-var hs-var">userSpecifyArgss</span></a></span></span><span> </span><span id="local-6989586621679688556"><span class="annot"><span class="annottext">[(String, [String])]
</span><a href="#local-6989586621679688556"><span class="hs-identifier hs-var">argss</span></a></span></span><span> </span><span id="local-6989586621679688555"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688555"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-274"></span><span>  </span><span class="annot"><span class="annottext">(ProgramDb -&gt; (String, [String]) -&gt; ProgramDb)
-&gt; ProgramDb -&gt; [(String, [String])] -&gt; ProgramDb
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679688554"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688554"><span class="hs-identifier hs-var">progdb'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688553"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688553"><span class="hs-identifier hs-var">prog</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688552"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688552"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyArgs"><span class="hs-identifier hs-var">userSpecifyArgs</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688553"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688552"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688554"><span class="hs-identifier hs-var">progdb'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688555"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, [String])]
</span><a href="#local-6989586621679688556"><span class="hs-identifier hs-var">argss</span></a></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-comment">-- | Get the path that has been previously specified for a program, if any.</span><span>
</span><span id="line-278"></span><span class="hs-comment">--</span><span>
</span><span id="line-279"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifiedPath"><span class="hs-identifier hs-type">userSpecifiedPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-280"></span><span id="userSpecifiedPath"><span class="annot"><span class="annottext">userSpecifiedPath :: Program -&gt; ProgramDb -&gt; Maybe String
</span><a href="Distribution.Simple.Program.Db.html#userSpecifiedPath"><span class="hs-identifier hs-var hs-var">userSpecifiedPath</span></a></span></span><span> </span><span id="local-6989586621679688550"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688550"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-281"></span><span>  </span><span class="annot"><span class="annottext">Maybe (Maybe String) -&gt; Maybe String
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Maybe String) -&gt; Maybe String)
-&gt; (ProgramDb -&gt; Maybe (Maybe String)) -&gt; ProgramDb -&gt; Maybe String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((Program, Maybe String, [String]) -&gt; Maybe String)
-&gt; Maybe (Program, Maybe String, [String]) -&gt; Maybe (Maybe String)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679688549"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679688549"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[String]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679688549"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe (Program, Maybe String, [String]) -&gt; Maybe (Maybe String))
-&gt; (ProgramDb -&gt; Maybe (Program, Maybe String, [String]))
-&gt; ProgramDb
-&gt; Maybe (Maybe String)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String
-&gt; UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String])
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688550"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String]))
-&gt; (ProgramDb -&gt; UnconfiguredProgs)
-&gt; ProgramDb
-&gt; Maybe (Program, Maybe String, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="hs-comment">-- | Get any extra args that have been previously specified for a program.</span><span>
</span><span id="line-285"></span><span class="hs-comment">--</span><span>
</span><span id="line-286"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#userSpecifiedArgs"><span class="hs-identifier hs-type">userSpecifiedArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ProgArg"><span class="hs-identifier hs-type">ProgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-287"></span><span id="userSpecifiedArgs"><span class="annot"><span class="annottext">userSpecifiedArgs :: Program -&gt; ProgramDb -&gt; [String]
</span><a href="Distribution.Simple.Program.Db.html#userSpecifiedArgs"><span class="hs-identifier hs-var hs-var">userSpecifiedArgs</span></a></span></span><span> </span><span id="local-6989586621679688548"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688548"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-288"></span><span>  </span><span class="annot"><span class="annottext">[String]
-&gt; ((Program, Maybe String, [String]) -&gt; [String])
-&gt; Maybe (Program, Maybe String, [String])
-&gt; [String]
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679688546"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688546"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span class="hs-glyph">-&gt;</span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688546"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe (Program, Maybe String, [String]) -&gt; [String])
-&gt; (ProgramDb -&gt; Maybe (Program, Maybe String, [String]))
-&gt; ProgramDb
-&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String
-&gt; UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String])
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688548"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(UnconfiguredProgs -&gt; Maybe (Program, Maybe String, [String]))
-&gt; (ProgramDb -&gt; UnconfiguredProgs)
-&gt; ProgramDb
-&gt; Maybe (Program, Maybe String, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">-- -----------------------------</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- Managing configured programs</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">-- | Try to find a configured program</span><span>
</span><span id="line-295"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-type">lookupProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span>
</span><span id="line-296"></span><span id="lookupProgram"><span class="annot"><span class="annottext">lookupProgram :: Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var hs-var">lookupProgram</span></a></span></span><span> </span><span id="local-6989586621679688545"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688545"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ConfiguredProgs -&gt; Maybe ConfiguredProgram
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688545"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; Maybe ConfiguredProgram)
-&gt; (ProgramDb -&gt; ConfiguredProgs)
-&gt; ProgramDb
-&gt; Maybe ConfiguredProgram
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span class="hs-comment">-- | Update a configured program in the database.</span><span>
</span><span id="line-300"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#updateProgram"><span class="hs-identifier hs-type">updateProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-301"></span><span>                                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-302"></span><span id="updateProgram"><span class="annot"><span class="annottext">updateProgram :: ConfiguredProgram -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateProgram"><span class="hs-identifier hs-var hs-var">updateProgram</span></a></span></span><span> </span><span id="local-6989586621679688544"><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688544"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-var">updateConfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">((ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb)
-&gt; (ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ConfiguredProgram -&gt; ConfiguredProgs -&gt; ConfiguredProgs
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programId"><span class="hs-identifier hs-var hs-var">programId</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688544"><span class="hs-identifier hs-var">prog</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688544"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span class="hs-comment">-- | List all configured programs.</span><span>
</span><span id="line-307"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configuredPrograms"><span class="hs-identifier hs-type">configuredPrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span id="configuredPrograms"><span class="annot"><span class="annottext">configuredPrograms :: ProgramDb -&gt; [ConfiguredProgram]
</span><a href="Distribution.Simple.Program.Db.html#configuredPrograms"><span class="hs-identifier hs-var hs-var">configuredPrograms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgs -&gt; [ConfiguredProgram]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; [ConfiguredProgram])
-&gt; (ProgramDb -&gt; ConfiguredProgs)
-&gt; ProgramDb
-&gt; [ConfiguredProgram]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">-- ---------------------------</span><span>
</span><span id="line-311"></span><span class="hs-comment">-- Configuring known programs</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="hs-comment">-- | Try to configure a specific program. If the program is already included in</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- the collection of unconfigured programs then we use any user-supplied</span><span>
</span><span id="line-315"></span><span class="hs-comment">-- location and arguments. If the program gets configured successfully it gets</span><span>
</span><span id="line-316"></span><span class="hs-comment">-- added to the configured collection.</span><span>
</span><span id="line-317"></span><span class="hs-comment">--</span><span>
</span><span id="line-318"></span><span class="hs-comment">-- Note that it is not a failure if the program cannot be configured. It's only</span><span>
</span><span id="line-319"></span><span class="hs-comment">-- a failure if the user supplied a location and the program could not be found</span><span>
</span><span id="line-320"></span><span class="hs-comment">-- at that location.</span><span>
</span><span id="line-321"></span><span class="hs-comment">--</span><span>
</span><span id="line-322"></span><span class="hs-comment">-- The reason for it not being a failure at this stage is that we don't know up</span><span>
</span><span id="line-323"></span><span class="hs-comment">-- front all the programs we will need, so we try to configure them all.</span><span>
</span><span id="line-324"></span><span class="hs-comment">-- To verify that a program was actually successfully configured use</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- 'requireProgram'.</span><span>
</span><span id="line-326"></span><span class="hs-comment">--</span><span>
</span><span id="line-327"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier hs-type">configureProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-328"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span>
</span><span id="line-329"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-330"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-331"></span><span id="configureProgram"><span class="annot"><span class="annottext">configureProgram :: Verbosity -&gt; Program -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier hs-var hs-var">configureProgram</span></a></span></span><span> </span><span id="local-6989586621679688541"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688540"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span id="local-6989586621679688539"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679688538"><span class="annot"><span class="annottext">name :: String
</span><a href="#local-6989586621679688538"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-333"></span><span>  </span><span id="local-6989586621679688537"><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
</span><a href="#local-6989586621679688537"><span class="hs-identifier hs-var">maybeLocation</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe String
</span><a href="Distribution.Simple.Program.Db.html#userSpecifiedPath"><span class="hs-identifier hs-var">userSpecifiedPath</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-334"></span><span>    </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-335"></span><span>      </span><span class="annot"><span class="annottext">Program
-&gt; Verbosity -&gt; ProgramSearchPath -&gt; IO (Maybe (String, [String]))
</span><a href="Distribution.Simple.Program.Types.html#programFindLocation"><span class="hs-identifier hs-var hs-var">programFindLocation</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>      </span><span class="annot"><span class="annottext">IO (Maybe (String, [String]))
-&gt; (Maybe (String, [String])
    -&gt; IO (Maybe (ProgramLocation, [String])))
-&gt; IO (Maybe (ProgramLocation, [String]))
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (ProgramLocation, [String])
 -&gt; IO (Maybe (ProgramLocation, [String])))
-&gt; (Maybe (String, [String]) -&gt; Maybe (ProgramLocation, [String]))
-&gt; Maybe (String, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((String, [String]) -&gt; (ProgramLocation, [String]))
-&gt; Maybe (String, [String]) -&gt; Maybe (ProgramLocation, [String])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([String], ProgramLocation) -&gt; (ProgramLocation, [String])
forall a b. (a, b) -&gt; (b, a)
</span><a href="../../base/src/Data.Tuple.html#swap"><span class="hs-identifier hs-var">swap</span></a></span><span> </span><span class="annot"><span class="annottext">(([String], ProgramLocation) -&gt; (ProgramLocation, [String]))
-&gt; ((String, [String]) -&gt; ([String], ProgramLocation))
-&gt; (String, [String])
-&gt; (ProgramLocation, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ProgramLocation)
-&gt; ([String], String) -&gt; ([String], ProgramLocation)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ProgramLocation
</span><a href="Distribution.Simple.Program.Types.html#FoundOnSystem"><span class="hs-identifier hs-var">FoundOnSystem</span></a></span><span> </span><span class="annot"><span class="annottext">(([String], String) -&gt; ([String], ProgramLocation))
-&gt; ((String, [String]) -&gt; ([String], String))
-&gt; (String, [String])
-&gt; ([String], ProgramLocation)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String, [String]) -&gt; ([String], String)
forall a b. (a, b) -&gt; (b, a)
</span><a href="../../base/src/Data.Tuple.html#swap"><span class="hs-identifier hs-var">swap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688534"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688534"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-338"></span><span>      </span><span id="local-6989586621679688533"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679688533"><span class="hs-identifier hs-var">absolute</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#doesExecutableExist"><span class="hs-identifier hs-var">doesExecutableExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688534"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-339"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679688533"><span class="hs-identifier hs-var">absolute</span></a></span><span>
</span><span id="line-340"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ProgramLocation, [String]) -&gt; Maybe (ProgramLocation, [String])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ProgramLocation
</span><a href="Distribution.Simple.Program.Types.html#UserSpecified"><span class="hs-identifier hs-var">UserSpecified</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688534"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; ProgramSearchPath -&gt; String -&gt; IO (Maybe (String, [String]))
</span><a href="Distribution.Simple.Program.Find.html#findProgramOnSearchPath"><span class="hs-identifier hs-var">findProgramOnSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688534"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-342"></span><span>             </span><span class="annot"><span class="annottext">IO (Maybe (String, [String]))
-&gt; (Maybe (String, [String])
    -&gt; IO (Maybe (ProgramLocation, [String])))
-&gt; IO (Maybe (ProgramLocation, [String]))
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">IO (Maybe (ProgramLocation, [String]))
-&gt; ((String, [String]) -&gt; IO (Maybe (ProgramLocation, [String])))
-&gt; Maybe (String, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO (Maybe (ProgramLocation, [String]))
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688528"><span class="hs-identifier hs-var">notFound</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (ProgramLocation, [String])
 -&gt; IO (Maybe (ProgramLocation, [String])))
-&gt; ((String, [String]) -&gt; Maybe (ProgramLocation, [String]))
-&gt; (String, [String])
-&gt; IO (Maybe (ProgramLocation, [String]))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ProgramLocation, [String]) -&gt; Maybe (ProgramLocation, [String])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">((ProgramLocation, [String]) -&gt; Maybe (ProgramLocation, [String]))
-&gt; ((String, [String]) -&gt; (ProgramLocation, [String]))
-&gt; (String, [String])
-&gt; Maybe (ProgramLocation, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([String], ProgramLocation) -&gt; (ProgramLocation, [String])
forall a b. (a, b) -&gt; (b, a)
</span><a href="../../base/src/Data.Tuple.html#swap"><span class="hs-identifier hs-var">swap</span></a></span><span> </span><span class="annot"><span class="annottext">(([String], ProgramLocation) -&gt; (ProgramLocation, [String]))
-&gt; ((String, [String]) -&gt; ([String], ProgramLocation))
-&gt; (String, [String])
-&gt; (ProgramLocation, [String])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; ProgramLocation)
-&gt; ([String], String) -&gt; ([String], ProgramLocation)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ProgramLocation
</span><a href="Distribution.Simple.Program.Types.html#UserSpecified"><span class="hs-identifier hs-var">UserSpecified</span></a></span><span> </span><span class="annot"><span class="annottext">(([String], String) -&gt; ([String], ProgramLocation))
-&gt; ((String, [String]) -&gt; ([String], String))
-&gt; (String, [String])
-&gt; ([String], ProgramLocation)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String, [String]) -&gt; ([String], String)
forall a b. (a, b) -&gt; (b, a)
</span><a href="../../base/src/Data.Tuple.html#swap"><span class="hs-identifier hs-var">swap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679688528"><span class="annot"><span class="annottext">notFound :: String
</span><a href="#local-6989586621679688528"><span class="hs-identifier hs-var hs-var">notFound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Cannot find the program '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688538"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-345"></span><span>                     </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'. User-specified path '&quot;</span></span><span>
</span><span id="line-346"></span><span>                     </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688534"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' does not refer to an executable and &quot;</span></span><span>
</span><span id="line-347"></span><span>                     </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the program is not on the system path.&quot;</span></span><span>
</span><span id="line-348"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
</span><a href="#local-6989586621679688537"><span class="hs-identifier hs-var">maybeLocation</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-349"></span><span>    </span><span class="annot"><span class="annottext">Maybe (ProgramLocation, [String])
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; IO ProgramDb
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-350"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688527"><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688527"><span class="hs-identifier hs-var">location</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679688526"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688526"><span class="hs-identifier hs-var">triedLocations</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-351"></span><span>      </span><span id="local-6989586621679688525"><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679688525"><span class="hs-identifier hs-var">version</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Verbosity -&gt; String -&gt; IO (Maybe Version)
</span><a href="Distribution.Simple.Program.Types.html#programFindVersion"><span class="hs-identifier hs-var hs-var">programFindVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramLocation -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#locationPath"><span class="hs-identifier hs-var hs-var">locationPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688527"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span>      </span><span id="local-6989586621679688522"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688522"><span class="hs-identifier hs-var">newPath</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProgramSearchPath -&gt; IO String
</span><a href="Distribution.Simple.Program.Find.html#programSearchPathAsPATHVar"><span class="hs-identifier hs-var">programSearchPathAsPATHVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramDb -&gt; ProgramSearchPath
</span><a href="Distribution.Simple.Program.Db.html#progSearchPath"><span class="hs-identifier hs-var hs-var">progSearchPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679688520"><span class="annot"><span class="annottext">configuredProg :: ConfiguredProgram
</span><a href="#local-6989586621679688520"><span class="hs-identifier hs-var hs-var">configuredProg</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram :: String
-&gt; Maybe Version
-&gt; [String]
-&gt; [String]
-&gt; [(String, Maybe String)]
-&gt; Map String String
-&gt; ProgramLocation
-&gt; [String]
-&gt; ConfiguredProgram
</span><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-354"></span><span>            </span><span class="annot"><span class="annottext">programId :: String
</span><a href="Distribution.Simple.Program.Types.html#programId"><span class="hs-identifier hs-var">programId</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688538"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-355"></span><span>            </span><span class="annot"><span class="annottext">programVersion :: Maybe Version
</span><a href="Distribution.Simple.Program.Types.html#programVersion"><span class="hs-identifier hs-var">programVersion</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679688525"><span class="hs-identifier hs-var">version</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-356"></span><span>            </span><span class="annot"><span class="annottext">programDefaultArgs :: [String]
</span><a href="Distribution.Simple.Program.Types.html#programDefaultArgs"><span class="hs-identifier hs-var">programDefaultArgs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-357"></span><span>            </span><span class="annot"><span class="annottext">programOverrideArgs :: [String]
</span><a href="Distribution.Simple.Program.Types.html#programOverrideArgs"><span class="hs-identifier hs-var">programOverrideArgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; [String]
</span><a href="Distribution.Simple.Program.Db.html#userSpecifiedArgs"><span class="hs-identifier hs-var">userSpecifiedArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-358"></span><span>            </span><span class="annot"><span class="annottext">programOverrideEnv :: [(String, Maybe String)]
</span><a href="Distribution.Simple.Program.Types.html#programOverrideEnv"><span class="hs-identifier hs-var">programOverrideEnv</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;PATH&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688522"><span class="hs-identifier hs-var">newPath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-359"></span><span>            </span><span class="annot"><span class="annottext">programProperties :: Map String String
</span><a href="Distribution.Simple.Program.Types.html#programProperties"><span class="hs-identifier hs-var">programProperties</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map String String
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-360"></span><span>            </span><span class="annot"><span class="annottext">programLocation :: ProgramLocation
</span><a href="Distribution.Simple.Program.Types.html#programLocation"><span class="hs-identifier hs-var">programLocation</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688527"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-361"></span><span>            </span><span class="annot"><span class="annottext">programMonitorFiles :: [String]
</span><a href="Distribution.Simple.Program.Types.html#programMonitorFiles"><span class="hs-identifier hs-var">programMonitorFiles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679688526"><span class="hs-identifier hs-var">triedLocations</span></a></span><span>
</span><span id="line-362"></span><span>          </span><span class="hs-special">}</span><span>
</span><span id="line-363"></span><span>      </span><span id="local-6989586621679688512"><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688512"><span class="hs-identifier hs-var">configuredProg'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Verbosity -&gt; ConfiguredProgram -&gt; IO ConfiguredProgram
</span><a href="Distribution.Simple.Program.Types.html#programPostConf"><span class="hs-identifier hs-var hs-var">programPostConf</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688540"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688520"><span class="hs-identifier hs-var">configuredProg</span></a></span><span>
</span><span id="line-364"></span><span>      </span><span class="annot"><span class="annottext">ProgramDb -&gt; IO ProgramDb
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-var">updateConfiguredProgs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ConfiguredProgram -&gt; ConfiguredProgs -&gt; ConfiguredProgs
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688538"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688512"><span class="hs-identifier hs-var">configuredProg'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688539"><span class="hs-identifier hs-var">progdb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="hs-comment">-- | Configure a bunch of programs using 'configureProgram'. Just a 'foldM'.</span><span>
</span><span id="line-368"></span><span class="hs-comment">--</span><span>
</span><span id="line-369"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configurePrograms"><span class="hs-identifier hs-type">configurePrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-370"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-371"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-372"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-373"></span><span id="configurePrograms"><span class="annot"><span class="annottext">configurePrograms :: Verbosity -&gt; [Program] -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configurePrograms"><span class="hs-identifier hs-var hs-var">configurePrograms</span></a></span></span><span> </span><span id="local-6989586621679688509"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688509"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688508"><span class="annot"><span class="annottext">[Program]
</span><a href="#local-6989586621679688508"><span class="hs-identifier hs-var">progs</span></a></span></span><span> </span><span id="local-6989586621679688507"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688507"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-374"></span><span>  </span><span class="annot"><span class="annottext">(ProgramDb -&gt; Program -&gt; IO ProgramDb)
-&gt; ProgramDb -&gt; [Program] -&gt; IO ProgramDb
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Program -&gt; ProgramDb -&gt; IO ProgramDb)
-&gt; ProgramDb -&gt; Program -&gt; IO ProgramDb
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; Program -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier hs-var">configureProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688509"><span class="hs-identifier hs-var">verbosity</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688507"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="annot"><span class="annottext">[Program]
</span><a href="#local-6989586621679688508"><span class="hs-identifier hs-var">progs</span></a></span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span class="hs-comment">-- | Unconfigure a program.  This is basically a hack and you shouldn't</span><span>
</span><span id="line-378"></span><span class="hs-comment">-- use it, but it can be handy for making sure a 'requireProgram'</span><span>
</span><span id="line-379"></span><span class="hs-comment">-- actually reconfigures.</span><span>
</span><span id="line-380"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#unconfigureProgram"><span class="hs-identifier hs-type">unconfigureProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-381"></span><span id="unconfigureProgram"><span class="annot"><span class="annottext">unconfigureProgram :: String -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#unconfigureProgram"><span class="hs-identifier hs-var hs-var">unconfigureProgram</span></a></span></span><span> </span><span id="local-6989586621679688505"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688505"><span class="hs-identifier hs-var">progname</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-382"></span><span>  </span><span class="annot"><span class="annottext">(ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#updateConfiguredProgs"><span class="hs-identifier hs-var">updateConfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">((ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb)
-&gt; (ConfiguredProgs -&gt; ConfiguredProgs) -&gt; ProgramDb -&gt; ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ConfiguredProgs -&gt; ConfiguredProgs
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#delete"><span class="hs-identifier hs-var">Map.delete</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688505"><span class="hs-identifier hs-var">progname</span></a></span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="hs-comment">-- | Try to configure all the known programs that have not yet been configured.</span><span>
</span><span id="line-385"></span><span class="hs-comment">--</span><span>
</span><span id="line-386"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#configureAllKnownPrograms"><span class="hs-identifier hs-type">configureAllKnownPrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-387"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-388"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-389"></span><span id="configureAllKnownPrograms"><span class="annot"><span class="annottext">configureAllKnownPrograms :: Verbosity -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configureAllKnownPrograms"><span class="hs-identifier hs-var hs-var">configureAllKnownPrograms</span></a></span></span><span> </span><span id="local-6989586621679688503"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688503"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688502"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688502"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-390"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; [Program] -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configurePrograms"><span class="hs-identifier hs-var">configurePrograms</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688503"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-391"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688501"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688501"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688501"><span class="hs-identifier hs-var">prog</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[String]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs -&gt; [(Program, Maybe String, [String])]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">UnconfiguredProgs
</span><a href="#local-6989586621679688500"><span class="hs-identifier hs-var">notYetConfigured</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688502"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-392"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-393"></span><span>    </span><span id="local-6989586621679688500"><span class="annot"><span class="annottext">notYetConfigured :: UnconfiguredProgs
</span><a href="#local-6989586621679688500"><span class="hs-identifier hs-var hs-var">notYetConfigured</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; UnconfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#unconfiguredProgs"><span class="hs-identifier hs-var hs-var">unconfiguredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688502"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-394"></span><span>      </span><span class="annot"><span class="annottext">UnconfiguredProgs -&gt; ConfiguredProgs -&gt; UnconfiguredProgs
forall k a b. Ord k =&gt; Map k a -&gt; Map k b -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#difference"><span class="hs-operator hs-var">`Map.difference`</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; ConfiguredProgs
</span><a href="Distribution.Simple.Program.Db.html#configuredProgs"><span class="hs-identifier hs-var hs-var">configuredProgs</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688502"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span>
</span><span id="line-397"></span><span class="hs-comment">-- | reconfigure a bunch of programs given new user-specified args. It takes</span><span>
</span><span id="line-398"></span><span class="hs-comment">-- the same inputs as 'userSpecifyPath' and 'userSpecifyArgs' and for all progs</span><span>
</span><span id="line-399"></span><span class="hs-comment">-- with a new path it calls 'configureProgram'.</span><span>
</span><span id="line-400"></span><span class="hs-comment">--</span><span>
</span><span id="line-401"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#reconfigurePrograms"><span class="hs-identifier hs-type">reconfigurePrograms</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-402"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-403"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ProgArg"><span class="hs-identifier hs-type">ProgArg</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-404"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-405"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-406"></span><span id="reconfigurePrograms"><span class="annot"><span class="annottext">reconfigurePrograms :: Verbosity
-&gt; [(String, String)]
-&gt; [(String, [String])]
-&gt; ProgramDb
-&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#reconfigurePrograms"><span class="hs-identifier hs-var hs-var">reconfigurePrograms</span></a></span></span><span> </span><span id="local-6989586621679688496"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688496"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688495"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679688495"><span class="hs-identifier hs-var">paths</span></a></span></span><span> </span><span id="local-6989586621679688494"><span class="annot"><span class="annottext">[(String, [String])]
</span><a href="#local-6989586621679688494"><span class="hs-identifier hs-var">argss</span></a></span></span><span> </span><span id="local-6989586621679688493"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688493"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-407"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; [Program] -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configurePrograms"><span class="hs-identifier hs-var">configurePrograms</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688496"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[Program]
</span><a href="#local-6989586621679688492"><span class="hs-identifier hs-var">progs</span></a></span><span>
</span><span id="line-408"></span><span>   </span><span class="annot"><span class="annottext">(ProgramDb -&gt; IO ProgramDb)
-&gt; (ProgramDb -&gt; ProgramDb) -&gt; ProgramDb -&gt; IO ProgramDb
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyPaths"><span class="hs-identifier hs-var">userSpecifyPaths</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679688495"><span class="hs-identifier hs-var">paths</span></a></span><span>
</span><span id="line-409"></span><span>   </span><span class="annot"><span class="annottext">(ProgramDb -&gt; ProgramDb)
-&gt; (ProgramDb -&gt; ProgramDb) -&gt; ProgramDb -&gt; ProgramDb
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, [String])] -&gt; ProgramDb -&gt; ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#userSpecifyArgss"><span class="hs-identifier hs-var">userSpecifyArgss</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, [String])]
</span><a href="#local-6989586621679688494"><span class="hs-identifier hs-var">argss</span></a></span><span>
</span><span id="line-410"></span><span>   </span><span class="annot"><span class="annottext">(ProgramDb -&gt; IO ProgramDb) -&gt; ProgramDb -&gt; IO ProgramDb
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688493"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-413"></span><span>    </span><span id="local-6989586621679688492"><span class="annot"><span class="annottext">progs :: [Program]
</span><a href="#local-6989586621679688492"><span class="hs-identifier hs-var hs-var">progs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Maybe Program] -&gt; [Program]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; ProgramDb -&gt; Maybe Program
</span><a href="Distribution.Simple.Program.Db.html#lookupKnownProgram"><span class="hs-identifier hs-var">lookupKnownProgram</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688490"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688493"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679688490"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688490"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679688495"><span class="hs-identifier hs-var">paths</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span class="hs-comment">-- | Check that a program is configured and available to be run.</span><span>
</span><span id="line-417"></span><span class="hs-comment">--</span><span>
</span><span id="line-418"></span><span class="hs-comment">-- It raises an exception if the program could not be configured, otherwise</span><span>
</span><span id="line-419"></span><span class="hs-comment">-- it returns the configured program.</span><span>
</span><span id="line-420"></span><span class="hs-comment">--</span><span>
</span><span id="line-421"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#requireProgram"><span class="hs-identifier hs-type">requireProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-422"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-423"></span><span id="requireProgram"><span class="annot"><span class="annottext">requireProgram :: Verbosity
-&gt; Program -&gt; ProgramDb -&gt; IO (ConfiguredProgram, ProgramDb)
</span><a href="Distribution.Simple.Program.Db.html#requireProgram"><span class="hs-identifier hs-var hs-var">requireProgram</span></a></span></span><span> </span><span id="local-6989586621679688489"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688489"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688488"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688488"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span id="local-6989586621679688487"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688487"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-424"></span><span>    </span><span id="local-6989586621679688486"><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
</span><a href="#local-6989586621679688486"><span class="hs-identifier hs-var">mres</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; Program
-&gt; ProgramDb
-&gt; IO (Maybe (ConfiguredProgram, ProgramDb))
</span><a href="Distribution.Simple.Program.Db.html#needProgram"><span class="hs-identifier hs-var">needProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688489"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688488"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688487"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-425"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
</span><a href="#local-6989586621679688486"><span class="hs-identifier hs-var">mres</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-426"></span><span>        </span><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO (ConfiguredProgram, ProgramDb)
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688489"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688485"><span class="hs-identifier hs-var">notFound</span></a></span><span>
</span><span id="line-427"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688484"><span class="annot"><span class="annottext">(ConfiguredProgram, ProgramDb)
</span><a href="#local-6989586621679688484"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgram, ProgramDb) -&gt; IO (ConfiguredProgram, ProgramDb)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgram, ProgramDb)
</span><a href="#local-6989586621679688484"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-428"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-429"></span><span>    </span><span id="local-6989586621679688485"><span class="annot"><span class="annottext">notFound :: String
</span><a href="#local-6989586621679688485"><span class="hs-identifier hs-var hs-var">notFound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The program '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688488"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' is required but it could not be found.&quot;</span></span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="hs-comment">-- | Check that a program is configured and available to be run.</span><span>
</span><span id="line-432"></span><span class="hs-comment">--</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- It returns 'Nothing' if the program couldn't be configured,</span><span>
</span><span id="line-434"></span><span class="hs-comment">-- or is not found.</span><span>
</span><span id="line-435"></span><span class="hs-comment">--</span><span>
</span><span id="line-436"></span><span class="hs-comment">-- @since 3.0.1.0</span><span>
</span><span id="line-437"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#needProgram"><span class="hs-identifier hs-type">needProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-438"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span id="needProgram"><span class="annot"><span class="annottext">needProgram :: Verbosity
-&gt; Program
-&gt; ProgramDb
-&gt; IO (Maybe (ConfiguredProgram, ProgramDb))
</span><a href="Distribution.Simple.Program.Db.html#needProgram"><span class="hs-identifier hs-var hs-var">needProgram</span></a></span></span><span> </span><span id="local-6989586621679688483"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688483"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688482"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688482"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span id="local-6989586621679688481"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688481"><span class="hs-identifier hs-var">progdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span>  </span><span class="hs-comment">-- If it's not already been configured, try to configure it now</span><span>
</span><span id="line-442"></span><span>  </span><span id="local-6989586621679688480"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688480"><span class="hs-identifier hs-var">progdb'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var">lookupProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688482"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688481"><span class="hs-identifier hs-var">progdb</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-443"></span><span>    </span><span class="annot"><span class="annottext">Maybe ConfiguredProgram
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Program -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier hs-var">configureProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688483"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688482"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688481"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-444"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; IO ProgramDb
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688481"><span class="hs-identifier hs-var">progdb</span></a></span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var">lookupProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688482"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688480"><span class="hs-identifier hs-var">progdb'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><span class="annottext">Maybe ConfiguredProgram
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
-&gt; IO (Maybe (ConfiguredProgram, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-448"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688479"><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688479"><span class="hs-identifier hs-var">configuredProg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (ConfiguredProgram, ProgramDb)
-&gt; IO (Maybe (ConfiguredProgram, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ConfiguredProgram, ProgramDb)
-&gt; Maybe (ConfiguredProgram, ProgramDb)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688479"><span class="hs-identifier hs-var">configuredProg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688480"><span class="hs-identifier hs-var">progdb'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span class="hs-comment">-- | Check that a program is configured and available to be run.</span><span>
</span><span id="line-451"></span><span class="hs-comment">--</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- Additionally check that the program version number is suitable and return</span><span>
</span><span id="line-453"></span><span class="hs-comment">-- it. For example you could require 'AnyVersion' or @'orLaterVersion'</span><span>
</span><span id="line-454"></span><span class="hs-comment">-- ('Version' [1,0] [])@</span><span>
</span><span id="line-455"></span><span class="hs-comment">--</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- It returns the configured program, its version number and a possibly updated</span><span>
</span><span id="line-457"></span><span class="hs-comment">-- 'ProgramDb'. If the program could not be configured or the version is</span><span>
</span><span id="line-458"></span><span class="hs-comment">-- unsuitable, it returns an error value.</span><span>
</span><span id="line-459"></span><span class="hs-comment">--</span><span>
</span><span id="line-460"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#lookupProgramVersion"><span class="hs-identifier hs-type">lookupProgramVersion</span></a></span><span>
</span><span id="line-461"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.VersionRange.Internal.html#VersionRange"><span class="hs-identifier hs-type">VersionRange</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-462"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-463"></span><span id="lookupProgramVersion"><span class="annot"><span class="annottext">lookupProgramVersion :: Verbosity
-&gt; Program
-&gt; VersionRange
-&gt; ProgramDb
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
</span><a href="Distribution.Simple.Program.Db.html#lookupProgramVersion"><span class="hs-identifier hs-var hs-var">lookupProgramVersion</span></a></span></span><span> </span><span id="local-6989586621679688478"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688478"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688477"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span id="local-6989586621679688476"><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688476"><span class="hs-identifier hs-var">range</span></a></span></span><span> </span><span id="local-6989586621679688475"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688475"><span class="hs-identifier hs-var">programDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-464"></span><span>
</span><span id="line-465"></span><span>  </span><span class="hs-comment">-- If it's not already been configured, try to configure it now</span><span>
</span><span id="line-466"></span><span>  </span><span id="local-6989586621679688474"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688474"><span class="hs-identifier hs-var">programDb'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var">lookupProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688475"><span class="hs-identifier hs-var">programDb</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-467"></span><span>    </span><span class="annot"><span class="annottext">Maybe ConfiguredProgram
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Program -&gt; ProgramDb -&gt; IO ProgramDb
</span><a href="Distribution.Simple.Program.Db.html#configureProgram"><span class="hs-identifier hs-var">configureProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688478"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688475"><span class="hs-identifier hs-var">programDb</span></a></span><span>
</span><span id="line-468"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProgramDb -&gt; IO ProgramDb
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688475"><span class="hs-identifier hs-var">programDb</span></a></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var">lookupProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688474"><span class="hs-identifier hs-var">programDb'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-471"></span><span>    </span><span class="annot"><span class="annottext">Maybe ConfiguredProgram
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String (ConfiguredProgram, Version, ProgramDb)
 -&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb)))
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Either String (ConfiguredProgram, Version, ProgramDb)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688473"><span class="hs-identifier hs-var">notFound</span></a></span><span>
</span><span id="line-472"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688472"><span class="annot"><span class="annottext">configuredProg :: ConfiguredProgram
</span><a href="#local-6989586621679688472"><span class="hs-identifier hs-var">configuredProg</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">programLocation :: ConfiguredProgram -&gt; ProgramLocation
</span><a href="Distribution.Simple.Program.Types.html#programLocation"><span class="hs-identifier hs-var">programLocation</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621679688471"><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688471"><span class="hs-identifier hs-var">location</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-473"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; Maybe Version
</span><a href="Distribution.Simple.Program.Types.html#programVersion"><span class="hs-identifier hs-var hs-var">programVersion</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688472"><span class="hs-identifier hs-var">configuredProg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-474"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679688470"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679688470"><span class="hs-identifier hs-var">version</span></a></span></span><span>
</span><span id="line-475"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Version -&gt; VersionRange -&gt; Bool
</span><a href="Distribution.Types.VersionRange.html#withinRange"><span class="hs-identifier hs-var">withinRange</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679688470"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688476"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-476"></span><span>            </span><span class="annot"><span class="annottext">Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String (ConfiguredProgram, Version, ProgramDb)
 -&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb)))
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgram, Version, ProgramDb)
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679688472"><span class="hs-identifier hs-var">configuredProg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679688470"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="hs-special">,</span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688474"><span class="hs-identifier hs-var">programDb'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-478"></span><span>            </span><span class="annot"><span class="annottext">Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String (ConfiguredProgram, Version, ProgramDb)
 -&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb)))
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Either String (ConfiguredProgram, Version, ProgramDb)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Version -&gt; ProgramLocation -&gt; String
forall {a}. Pretty a =&gt; a -&gt; ProgramLocation -&gt; String
</span><a href="#local-6989586621679688468"><span class="hs-identifier hs-var">badVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679688470"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688471"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-479"></span><span>        </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                       </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-480"></span><span>          </span><span class="annot"><span class="annottext">Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String (ConfiguredProgram, Version, ProgramDb)
 -&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb)))
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Either String (ConfiguredProgram, Version, ProgramDb)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramLocation -&gt; String
</span><a href="#local-6989586621679688467"><span class="hs-identifier hs-var">unknownVersion</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688471"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span>
</span><span id="line-482"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679688473"><span class="annot"><span class="annottext">notFound :: String
</span><a href="#local-6989586621679688473"><span class="hs-identifier hs-var hs-var">notFound</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The program '&quot;</span></span><span>
</span><span id="line-483"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688466"><span class="hs-identifier hs-var">versionRequirement</span></a></span><span>
</span><span id="line-484"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is required but it could not be found.&quot;</span></span><span>
</span><span id="line-485"></span><span>        </span><span id="local-6989586621679688468"><span class="annot"><span class="annottext">badVersion :: a -&gt; ProgramLocation -&gt; String
</span><a href="#local-6989586621679688468"><span class="hs-identifier hs-var hs-var">badVersion</span></a></span></span><span> </span><span id="local-6989586621679688463"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679688463"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679688462"><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688462"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The program '&quot;</span></span><span>
</span><span id="line-486"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688466"><span class="hs-identifier hs-var">versionRequirement</span></a></span><span>
</span><span id="line-487"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is required but the version found at &quot;</span></span><span>
</span><span id="line-488"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#locationPath"><span class="hs-identifier hs-var hs-var">locationPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688462"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is version &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679688463"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-489"></span><span>        </span><span id="local-6989586621679688467"><span class="annot"><span class="annottext">unknownVersion :: ProgramLocation -&gt; String
</span><a href="#local-6989586621679688467"><span class="hs-identifier hs-var hs-var">unknownVersion</span></a></span></span><span> </span><span id="local-6989586621679688460"><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688460"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The program '&quot;</span></span><span>
</span><span id="line-490"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programName"><span class="hs-identifier hs-var hs-var">programName</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688477"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679688466"><span class="hs-identifier hs-var">versionRequirement</span></a></span><span>
</span><span id="line-491"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is required but the version of &quot;</span></span><span>
</span><span id="line-492"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#locationPath"><span class="hs-identifier hs-var hs-var">locationPath</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramLocation
</span><a href="#local-6989586621679688460"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; could not be determined.&quot;</span></span><span>
</span><span id="line-493"></span><span>        </span><span id="local-6989586621679688466"><span class="annot"><span class="annottext">versionRequirement :: String
</span><a href="#local-6989586621679688466"><span class="hs-identifier hs-var hs-var">versionRequirement</span></a></span></span><span>
</span><span id="line-494"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">VersionRange -&gt; Bool
</span><a href="Distribution.Types.VersionRange.html#isAnyVersion"><span class="hs-identifier hs-var">isAnyVersion</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688476"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-495"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; version &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688476"><span class="hs-identifier hs-var">range</span></a></span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span class="hs-comment">-- | Like 'lookupProgramVersion', but raises an exception in case of error</span><span>
</span><span id="line-498"></span><span class="hs-comment">-- instead of returning 'Left errMsg'.</span><span>
</span><span id="line-499"></span><span class="hs-comment">--</span><span>
</span><span id="line-500"></span><span class="annot"><a href="Distribution.Simple.Program.Db.html#requireProgramVersion"><span class="hs-identifier hs-type">requireProgramVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.VersionRange.Internal.html#VersionRange"><span class="hs-identifier hs-type">VersionRange</span></a></span><span>
</span><span id="line-501"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span>
</span><span id="line-502"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Program.Types.html#ConfiguredProgram"><span class="hs-identifier hs-type">ConfiguredProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#ProgramDb"><span class="hs-identifier hs-type">ProgramDb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span id="requireProgramVersion"><span class="annot"><span class="annottext">requireProgramVersion :: Verbosity
-&gt; Program
-&gt; VersionRange
-&gt; ProgramDb
-&gt; IO (ConfiguredProgram, Version, ProgramDb)
</span><a href="Distribution.Simple.Program.Db.html#requireProgramVersion"><span class="hs-identifier hs-var hs-var">requireProgramVersion</span></a></span></span><span> </span><span id="local-6989586621679688456"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688456"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679688455"><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688455"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span id="local-6989586621679688454"><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688454"><span class="hs-identifier hs-var">range</span></a></span></span><span> </span><span id="local-6989586621679688453"><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688453"><span class="hs-identifier hs-var">programDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-504"></span><span>  </span><span class="annot"><span class="annottext">IO (IO (ConfiguredProgram, Version, ProgramDb))
-&gt; IO (ConfiguredProgram, Version, ProgramDb)
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (IO (ConfiguredProgram, Version, ProgramDb))
 -&gt; IO (ConfiguredProgram, Version, ProgramDb))
-&gt; IO (IO (ConfiguredProgram, Version, ProgramDb))
-&gt; IO (ConfiguredProgram, Version, ProgramDb)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO (ConfiguredProgram, Version, ProgramDb))
-&gt; ((ConfiguredProgram, Version, ProgramDb)
    -&gt; IO (ConfiguredProgram, Version, ProgramDb))
-&gt; Either String (ConfiguredProgram, Version, ProgramDb)
-&gt; IO (ConfiguredProgram, Version, ProgramDb)
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO (ConfiguredProgram, Version, ProgramDb)
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688456"><span class="hs-identifier hs-var">verbosity</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ConfiguredProgram, Version, ProgramDb)
-&gt; IO (ConfiguredProgram, Version, ProgramDb)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String (ConfiguredProgram, Version, ProgramDb)
 -&gt; IO (ConfiguredProgram, Version, ProgramDb))
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
-&gt; IO (IO (ConfiguredProgram, Version, ProgramDb))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span>
</span><span id="line-505"></span><span>  </span><span class="annot"><span class="annottext">Verbosity
-&gt; Program
-&gt; VersionRange
-&gt; ProgramDb
-&gt; IO (Either String (ConfiguredProgram, Version, ProgramDb))
</span><a href="Distribution.Simple.Program.Db.html#lookupProgramVersion"><span class="hs-identifier hs-var">lookupProgramVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679688456"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="#local-6989586621679688455"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="annot"><span class="annottext">VersionRange
</span><a href="#local-6989586621679688454"><span class="hs-identifier hs-var">range</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679688453"><span class="hs-identifier hs-var">programDb</span></a></span><span>
</span><span id="line-506"></span></pre></body></html>